import request from '../request'

//获取商城首页Banner及快捷入口
export const getMallIndex = params => request.globalRequest(`aos/app/unionPage/mallIndex`, 'GET', params)

// 获取药品列表
export const getMedicineList = params => request.globalRequest(`aos/api/commodity/appList`, 'GET', params)

// 获取药品分类二级结构
export const getMedicineSorts = params => request.globalRequest(`aos/api/commodityType/getCommodityTypeToApp`, 'GET', params)

// 获取药品详情
export const getMedicineDetail = params => request.globalRequest(`aos/api/commodity/appDetail`, 'GET', params)

// 获取购物车商品数量（1:有效的商品 2:失效的商品 (传0或空 查全部数量)）
export const getCartCount = params => request.globalRequest(`aos/api/shoppingCart/myCount`, 'GET', params, false)

// 将商品加入购物车
export const addIntoCart = params => request.globalRequest(`aos/api/shoppingCart/add`, 'POST', params)

// 获取购物车列表
export const getCartList = params => request.globalRequest(`aos/api/shoppingCart/list`, 'GET', params)

// 修改购物车商品数量
export const changeCartCount = params => request.globalRequest(`aos/api/shoppingCart/updateCount`, 'POST', params)

// 删除购物车商品
export const deleteFromCart = params => request.globalRequest(`aos/api/shoppingCart/delete`, 'DELETE', params)

// 获取确认订单页面展示的信息
export const getOrderCreateBase = params => request.globalRequest(`aos/api/shoppingCart/beforeOrderConfirm`, 'POST', params)

// 获取某一组商品的运费
export const countExpressPrice = params => request.globalRequest(`aos/api/shoppingCart/getFreightAmountByInfo`, 'POST', params)

// 提交订单
export const createOrder = params => request.globalRequest(`aos/api/commodityOrder/submitOrder`, 'POST', params)

// 使用订单号请求支付
export const payOrder = params => request.globalRequest(`aos/api/commodityOrder/wxPay`, 'POST', params)

// 佣金上面的统计
export const getDistributeStats = params => request.globalRequest(`aos/distribute/info/countInfo`, 'GET', params)

// 佣金注册用户列表
export const getDistributeUsers = params => request.globalRequest(`aos/distribute/info/registerList`, 'GET', params)

// 佣金消费明细列表
export const getDistributeOrders = params => request.globalRequest(`aos/distribute/info/orderList`, 'GET', params)

// 获取我的积分
export const getUserPoint = params => request.globalRequest(`aos/distribute/info/getMyScore`, 'GET', {}, false)